<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		
	</head>
	<body>
	</body>
	<script>
		var wu1=59,wu2=30,wu3=199,wu4=68;
		var shu=prompt("请输入购买的《JavaScript》书的数量"," ");
		var gangbi=prompt("请输入购买的钢笔的数量"," ");
		var yanjing=prompt("请输入购买眼睛的数量"," ");
		var niunai=prompt("请输入购买牛奶的数量"," ");
	if(shu==1){
		var qian1=wu1*0.9;
	}else if(shu==2){
		var qian1=wu1*0.8*2;
	}else if(shu==3){
		var qian1=wu1*0.7*3;
	}else if (shu>=4){
		var qian1=wu1*0.65*4;
	}
	
	if(gangbi==1){
		var qian2=wu2*0.9;
	}else if(gangbi==2){
		var qian2=wu2*0.8*2;
	}else if(gangbi==3){
		var qian2=wu2*0.7*3;
	}else if (gangbi>=4){
		var qian2=wu2*0.65*4;
	}
	
	if(yanjing==1){
		var qian3=wu3*0.9;
	}else if(yanjing==2){
		var qian3=wu3*0.8*2;
	}else if(yanjing==3){
		var qian3=wu3*0.7*3;
	}else if (yanjing>=4){
		var qian3=wu3*0.65*4;
	}
	
	if(niunai==1){
		var qian4=wu4*0.9;
	}else if(niunai==2){
		var qian4=wu4*0.8*2;
	}else if(niunai==3){
		var qian4=wu4*0.7*3;
	}else if (niunai>=4){
		var qian4=wu4*0.65*4;
	}else{
		document.write("请输入正确数字")
	}
	document.write(qian1+qian2+qian3+qian4);
	</script>
</html>
